package cn.yunhe.action;

import cn.yunhe.entity.Page;
import cn.yunhe.entity.User;
import com.opensymphony.xwork2.ActionSupport;

import java.util.ArrayList;
import java.util.List;

public class UserAction extends ActionSupport {

    private Page page;

    @Override
    public String execute() throws Exception {
        User u1 = new User(1, "zhansgan");
        User u2 = new User(2, "lisi");
        User u3 = new User(3, "wangwu");
        User u4 = new User(4, "zhaoliu");
        User u5 = new User(5, "wangsan");

        List<User> users = new ArrayList<User>();
        users.add(u1);users.add(u2);users.add(u3);users.add(u4);users.add(u5);
        page=new Page();
        page.setUserList(users);
        page.setPageSize(2);
        page.setTotalPages(30);
        return SUCCESS;
    }

    public Page getPage() {
        return page;
    }

    public void setPage(Page page) {
        this.page = page;
    }
}
